package com.zjsd.sqeybusiness.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zjsd.sqeybusiness.mapper.CompanyMainCategoryMapper;
import com.zjsd.sqeybusiness.domain.CompanyMainCategory;
import com.zjsd.sqeybusiness.service.ICompanyMainCategoryService;

/**
 * 企业主营分类Service业务层处理
 *
 * @author Zheng
 * @date 2020-11-05
 */
@Service
public class CompanyMainCategoryServiceImpl implements ICompanyMainCategoryService
{
    @Autowired
    private CompanyMainCategoryMapper companyMainCategoryMapper;

    /**
     * 查询企业主营分类
     *
     * @param categoryId 企业主营分类ID
     * @return 企业主营分类
     */
    @Override
    public CompanyMainCategory selectCompanyMainCategoryById(Long categoryId)
    {
        return companyMainCategoryMapper.selectCompanyMainCategoryById(categoryId);
    }

    /**
     * 查询企业主营分类列表
     *
     * @param companyMainCategory 企业主营分类
     * @return 企业主营分类
     */
    @Override
    public List<CompanyMainCategory> selectCompanyMainCategoryList(CompanyMainCategory companyMainCategory)
    {
        return companyMainCategoryMapper.selectCompanyMainCategoryList(companyMainCategory);
    }

    /**
     * 新增企业主营分类
     *
     * @param companyMainCategory 企业主营分类
     * @return 结果
     */
    @Override
    public int insertCompanyMainCategory(CompanyMainCategory companyMainCategory)
    {
        return companyMainCategoryMapper.insertCompanyMainCategory(companyMainCategory);
    }

    /**
     * 修改企业主营分类
     *
     * @param companyMainCategory 企业主营分类
     * @return 结果
     */
    @Override
    public int updateCompanyMainCategory(CompanyMainCategory companyMainCategory)
    {
        return companyMainCategoryMapper.updateCompanyMainCategory(companyMainCategory);
    }

    /**
     * 批量删除企业主营分类
     *
     * @param categoryIds 需要删除的企业主营分类ID
     * @return 结果
     */
    @Override
    public int deleteCompanyMainCategoryByIds(Long[] categoryIds)
    {
        return companyMainCategoryMapper.deleteCompanyMainCategoryByIds(categoryIds);
    }

    /**
     * 删除企业主营分类信息
     *
     * @param categoryId 企业主营分类ID
     * @return 结果
     */
    @Override
    public int deleteCompanyMainCategoryById(Long categoryId)
    {
        return companyMainCategoryMapper.deleteCompanyMainCategoryById(categoryId);
    }
}
